As a compression recording standard of a moving image, there is known H.264/MPEG-4 AVC (hereinafter referred to as H.264). (ITU-T H.264 (March 2010) Advanced video coding for generic audiovisual services) Regarding H.264, each element of a quantization matrix can be changed into an arbitrary value by coding scaling list information. According to chapter 7.3.2.1.1.1 of H.264, by adding a delta scale being a difference value between an element and its previous element, each element of the quantization matrix can take an arbitrary value.
Regarding H.264, elements of the quantization matrix are scanned in the direction from the element in the upper left corner of the two-dimensional quantization matrix, which corresponds to a low frequency component, to the element in the bottom right corner, which corresponds to a high frequency component. For example, in coding a two-dimensional quantization matrix illustrated in FIG. 6A, a scanning method called zigzag scanning illustrated in FIG. 13A is used. According to this processing, the quantization matrix is arranged into a one-dimensional matrix illustrated in FIG. 6B. Then, the difference between an element to be coded in the matrix and its previous element is calculated, and the matrix of the difference values illustrated in FIG. 6D is obtained. Further, the difference values are coded as a delta scale by a method called signed Exp-Golomb coding illustrated in FIG. 5A. For example, if the difference between an element in the matrix and its previous element is 0, a binary code 1 is coded. If the difference is −2, a binary code 00101 is coded.
However, regarding the zigzag scanning used in H.264, since elements of the quantization matrix are scanned in the diagonal direction, the amount of code of the quantization matrix is increased depending on the characteristics of the quantization matrix.